/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package carrello.impl.controller.administrator;

import carrello.model.association.AttributeValue;
import carrello.impl.controller.AbstractCTRL;
import carrello.model.entities.Product;
import static carrello.util.EntityManagerUtil.getEntityManager;
/**
 *
 * @author Usman
 */
public class DeleteProductCTRL extends AbstractCTRL {
    public static boolean deleteProduct (int id) {
        init();
        Product p = Product.getProductById(id);
        new AttributeValue().delete(p);
        getEntityManager().remove(p);
        end();
        return true;
    }
}
